*This file handles the stat version and ado packages used for the DHOZ replication.

global root_dir = "`1'"

include "$root_dir/code/config/config.do"


cap noi log using ${log_dir}/requirements.log, replace name(requirements)

capture noi {

    *check the stata version
    if `c(stata_version)' < 17 {
        display as error "This do-file requires Stata version 17 or higher."
        exit 9999
    }

    *list of required packages
    require using ${code_dir}/config/requirements.txt, install

}
if _rc == 0 {
    display "Execution finished successfully."
}
else {
    display "Execution finished with errors."
}

cap log close requirements

